<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .account {
            width: 400px;
            margin: 0 auto;
        }
    </style>
</head>
<body>

<div class="account">
    <h1>注册</h1>
    <form>
        {% for foo in form %}
            {% if foo.name == 'code' %}
                <div class="form-group">
                    {#           {{ foo.id_for_label }}表示当你点击这个label时候对应的id就可以获取到input里面的内容 #}
                    <label for="{{ foo.id_for_label }}">{{ foo.label }}</label>
                    {#            <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">#}
                    <div class="clearfix">
                        <div class="col-md-6" style="padding-left: 0">{{ foo }}</div>
                        <div class="col-md-6"><input type="button" class="btn btn-default" value="点击获取验证码"></div>
                    </div>
                </div>
            {% else %}
                <div class="form-group">
                    {#           {{ foo.id_for_label }}表示当你点击这个label时候对应的id就可以获取到input里面的内容 #}
                    <label for="{{ foo.id_for_label }}">{{ foo.label }}</label>
                    {#            <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">#}
                    {{ foo }}
                </div>
            {% endif %}
        {% endfor %}
        <button type="submit" class="btn btn-primary">注册</button>
    </form>

</div>

</body>
</html>